package com.mr.web;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.mr.web.app.ProductsApp;

@Controller
@RequestMapping(value = "/products.htm")
public class ProductsController {

	@Resource
	private ProductsApp app;

	@RequestMapping()
	public ModelMap render(@RequestParam String categoryId) throws Exception {
		ModelMap model = new ModelMap();
		app.load(model, categoryId);
		return model;
	}
}
